Field
Embodiments presented herein generally relate to processing function calls performed by object schema-based application programming interfaces (APIs), and more specifically to optimizing certain read and write operations to data stored according to a given object schema across a collection of nodes.
Description of the Related Art
Application programming interfaces (APIs) generally expose various routines and methods to software developers for use in obtaining and modifying data using features of a software application. APIs may be accessible programmatically (e.g., as function calls in an application or function library) or via a web-service (e.g., WSDL) for web-based applications. Web-based applications can invoke functionality exposed by an API, for example, using a Representational State Transfer function call (a RESTful function call). A RESTful call generally uses HTTP messages to invoke a function exposed by a web-based API and pass data to the invoked function for processing. In other cases, web-based applications can invoke API functions using queries encapsulated in an HTTP POST request, a Simple Object Access Protocol (SOAP) request, according to a web service standard (e.g., WSDL) or according to other protocols that allow client software to invoke functions on a remote system.
Data sources associated with an API may model some data as a one-to-many relationship, where one record in a first data source can reference multiple records in a second data source. For example, in a relational database, a first table may identify an instance of a first object using an identifier assigned to the first object, and a second table may associate multiple second objects with a first object using a key. When an API call processes a request to obtain data modeled as a one-to-many relationship, the API call may generate a first query to obtain an identifier to use to query another data source for multiple pieces of related data. Similarly, when API calls are invoked to write one-to-many relationships to a data repository, the invoked API call can generate multiple, individual write queries to commit data to the data repository.